<?php
include 'conn.php';
$link=connnect();
if(!$link){
	die('数据库连接失败!'.mysqli_error($link));
}
$username = $_GET['username'];
$password = $_GET['password'];
//用户信息验证
$sql = "select * from `user` where `user`.username='$username' and `user`.password=$password";
//执行sql语句
$res=mysqli_query($link, $sql);
//得到每一条数据;
$row=mysqli_fetch_array($res, MYSQL_ASSOC);
$arr=array();
if($res->num_rows){
	$arr['code']=1;
	$arr['data']=$row;
}
else{
	$arr['code']=0;
}
echo json_encode($arr);
?>
